![]() |
Java Database Programming with JDBC
by Pratik Patel Coriolis, The Coriolis Group ISBN: 1576100561 Pub Date: 10/01/96 |
Previous | Table of Contents | Next |
Methods
Method Name | Additional Description |
---|---|
public abstract void clearWarnings() throws SQLException | Clears the warnings for the connection |
public abstract void close() throws SQLException | Closes the connection to the database |
public abstract void commit() throws SQLException | Functions as the JDBC equivalent of the standard database commit command; it applies all commands and changes made since the last commit or rollback, including releasing database locks; results from queries are closed when commit is invoked |
public abstract Statement createStatement() throws SQLException | Returns a Statement object, which can then be used to perform actual queries |
public abstract boolean getAutoClose() throws SQLException | Returns true if automatic closing of the connection is enabled; automatic closing results in the closing of the connection when commit or rollback is performed |
public abstract boolean getAutoCommit() throws SQLException | Returns true if automatic committing of the connection is on; automatic commit is on by default and means that the connection is committed on individual transactions; the actual commit occurs when the last row of a result set is fetched, or when the ResultSet is closed |
public abstract String getCatalog() throws SQLException | Returns the current catalog name for the connection |
public abstract DatabaseMetaData getMetaData() throws SQLException | Returns a DatabaseMetaData object for the current connection |
public abstract int getTransactionIsolation() throws SQLException | Returns the transaction isolation mode of the connection |
public abstract SQLWarning getWarnings() throws SQLException | Returns the SQLWarning object with the warnings for the connection |
public abstract boolean isClosed() throws SQLException | Returns true if the connection has been closed |
public abstract boolean isReadOnly() throws SQLException | Returns true if the connection is a read only connection |
public abstract String nativeSQL(String throws SQLException | Returns the native SQL that the JDBC driver sqlQuery) would send to the database for the specified sqlQuery parameter |
public abstract CallableStatement prepareCall(String sqlQuery) throws SQLException | Returns a CallableStatement object used to perform stored procedures; note that the SQL query must be passed in as the sqlQuery parameter here |
public abstract PreparedStatement prepareStatement(String sqlQuery) throws SQLException | Returns a PreparedStatement object used to perform the specified sqlQuery; this query can be executed repeatedly if desired by using the PreparedStatement.execute method |
public abstract void rollback() throws SQLException | Drops changes made since the last commit or rollback, and closes respective results; database locks are also released |
public abstract void setAutoClose (boolean throws SQLException | Sets the connection to auto close mode if the auto) auto parameter is true |
public abstract void throws SQLException | Sets the connection to auto commit mode if setAutoCommit(boolean auto) the auto parameter is true |
public abstract void setCatalog (String catalog) throws SQLException | The catalog may be changed by specifying the catalog |
public abstract void setReadOnly(boolean readOnly) throws SQLException | Sets the connection to read only mode |
public abstract void setTransactionIsolation(int level) throws SQLException | Sets translation isolation to the specified level |
Variables
The following constants are used in the setTransactionIsolation method as the level parameter:
This class contains useful information about the open connection to the database. The Connection.getMetaData method returns a Database-MetaData object that is specific to the opened connection.
Previous | Table of Contents | Next |